<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"
%><%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"
%><%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"
%><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
%>
<head>
    <title><fmt:message key="fileAsset" /></title>
	<script language="JavaScript">
	<!--
		dojo.require("dotcms.dijit.form.HostFolderFilteringSelect");
	//-->
	</script>
</head>
<body>
    <h1><fmt:message key="fileAsset" /></h1>
    <c:url var="createUrl" value="/domain/fileAsset/create.action"/>
    <form:form action="${createUrl}" id="fileAssetForm" modelAttribute="fileAssetForm" enctype="multipart/form-data">
        <form:errors cssClass="error"/>
        <table>
            <form:hidden path="fileAsset.inode"/>
            <tbody>
                <tr>
                    <th>${relationShip.childRelationName}*</th>
                    <td>
						<c:url var="contentUrl" value="/domain/contentlet/show">
							<c:param name="contentlet.inode" value="${contentlet.inode}" />
						</c:url>
						<a href="${contentUrl}">${contentlet.title}</a>
						<form:hidden path="contentletInode"/>
						<form:hidden path="relationshipInode"/>
					</td>
                </tr>

                <tr>
                    <th><fmt:message key="fileAsset_title" /></th>
                    <td>
                        <form:input path="fileAsset.title"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "fileAsset.title",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="fileAsset.title"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="fileAsset_friendlyName" /></th>
                    <td>
                        <form:input path="fileAsset.friendlyName"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "fileAsset.friendlyName",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="fileAsset.friendlyName"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="fileAsset" /></th>
                    <td>
						<input type="file" name="file" />
                        <form:errors cssClass="error" path="file"/>
                    </td>
                </tr>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="2">
                        <div class="buttons">
                            <button id="saveButton" class="ok" type="submit"><fmt:message key="label.form.submit"/></button>
                            <script type="text/javascript">
                                Spring.addDecoration(new Spring.ValidateAllDecoration({
                                    elementId:'saveButton',
                                    event:'onclick'
                                }));
                            </script>
                        </div>
                    </td>
                </tr>
            </tfoot>
        </table>
    </form:form>
</body>
